<?php
	include_once 'Config.php';
	include_once 'Router.php';
	include_once 'model/DBConnection.php';
	include_once 'controller/Err404Controller.php';
	include_once 'controller/MainController.php';	
	include_once 'model/Session.php';
	include_once 'model/UserDAO.php';
	include_once 'model/User.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<?php
	
	echo '<!-- error level: '.error_reporting().'-->'."\n";
	
	function init() {
		DBConnection::setHost(Config::HOST);
		DBConnection::setLogin(Config::LOGIN);
		DBConnection::setPass(Config::PASSWORD);
		DBConnection::setDBName(Config::DB_NAME);
	} 	
	
	init();
	
	$controller = Router::getController();
	if($controller === null) {
		$controller = "Err404Controller";
		include_once "controller/Err404Controller.php";
	}
		
	$controller = new $controller;
	$act=Router::getAction();	
	
	//$controller->header(Router::getParams()); //render css, js etc
	$controller->$act(Router::getParams());
?>
</html>